// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取报警类型列表 GET /api/alarm/type */
export async function queryAlarmType(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/alarm/type', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新报警类型 PUT /api/alarm/type */
export async function updateAlarmType(body: API.AlarmTypeItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/alarm/type', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加报警类型 POST /api/alarm/type */
export async function addAlarmType(body: API.AlarmTypeItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/alarm/type', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除报警类型 DELETE /api/alarm/type */
export async function removeAlarmType(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/alarm/type', {
    method: 'DELETE',
    ...(options || {}),
  });
}
